package cn.victor.service.impl;

import cn.victor.service.IDemoApi;
import org.apache.dubbo.config.annotation.Service;

import java.util.Random;

@Service
public class DemoApi implements IDemoApi {
    private Random random = new Random();
    public void methodA() {
        sleepRandom();
        System.out.println("call methodA");
    }

    public void methodB() {
        sleepRandom();
        System.out.println("call methodB");
    }

    public void methodC() {
        sleepRandom();
        System.out.println("call methodC");
    }
    public void sleepRandom(){
        try {
            Thread.sleep(random.nextInt(100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

}
